import { getFieldConfig } from '@/services/center';
import { useRequest } from 'ahooks';
import { useState } from 'react';

export default function Page() {
  const [step, setStep] = useState(1);
  const [key, setKey] = useState<Record<string, { key: string }[]> | string[]>();
  // 获取字段配置
  const { run: runConfig } = useRequest(getFieldConfig, {
    manual: true,
    onSuccess: (data) => {
      setKey(data.data);
    },
  });
  return {
    step,
    setStep,
    runConfig,
    key,
    setKey,
  };
}
